﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace MVC_登陆登出及验证.Models
{
    public class LoginViewModels
    {
        [Required]
        [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
        [Display(Name  ="用户名")]
        public string UName { get; set; }
        [Required]
        [Display(Name = "密码")]
        [StringLength(25,ErrorMessage ="{0}必须至少包含{2}个字符.")]
        [DataType(DataType.Password)]
        public string Password { get; set; }
    
        [Display(Name ="记住我?")]
        public bool Rememberme { get; set; }
    }
    [Serializable]
    public class RegisterViewModel
    {
        [Required]
        [StringLength(100, ErrorMessage = "{0} 必须至少包含 {2} 个字符。", MinimumLength = 6)]
        [Display(Name = "用户名")]
        public string UName { get; set; }
        [Display(Name ="姓名")]
        public string RealName { get; set; }
        [Required]
        [Display(Name = "密码")]
        [StringLength(25, ErrorMessage = "{0}必须至少包含{2}个字符.")]
        [DataType(DataType.Password)]
        public string Password { get; set; }
        [Required]
        [Display(Name ="确认密码")]
        [DataType(DataType.Password)]
        [Compare("Password",ErrorMessage ="密码和确认密码不一致.")]
        public string ConfirmPassword { get; set; }
        [Required]
        [Display(Name = "邮箱地址")]
        [EmailAddress]
        public string EMail { get; set; }
        [Display(Name = "性别")]
        public int Gender { get; set; }
       
    }
    
}